package com.vne.skyemart.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.CascadeType;
@Entity
@Table(name = "Status",catalog = "skyemart_db")
public class Status implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7231541959601287605L;

	@Id
	@GeneratedValue
	@Column(name = "StatusID",nullable = false,unique = true)
	private int statusID;

	@Column(name = "StatusName",nullable = false,length = 50,unique = true)
	private String statusName;

	@Column(name = "Available",nullable = false)
	private boolean available = true;

	@OneToOne(fetch = FetchType.LAZY,mappedBy = "status",cascade = CascadeType.ALL)
	private Payment payment;
	/**
	 * CONSTRUCTOR 
	 *
	 */
	public Status() {}
	
	public Status(int statusID, String statusName, boolean available,
			Payment payment) {
		super();
		this.statusID = statusID;
		this.statusName = statusName;
		this.available = available;
		this.payment = payment;
	}
	/**
	 * GETTER AND SETTER
	 * 
	 */
	public int getStatusID() {
		return statusID;
	}
	public void setStatusID(int statusID) {
		this.statusID = statusID;
	}
	public String getStatusName() {
		return statusName;
	}
	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}
	public boolean isAvailable() {
		return available;
	}
	public void setAvailable(boolean available) {
		this.available = available;
	}
	public Payment getPayment() {
		return payment;
	}
	public void setPayment(Payment payment) {
		this.payment = payment;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
